<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>test.html</title>
	
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
   <script type="text/javascript" src="../../js/jquery-1.10.0.js"></script>
   <script type="text/javascript">
   </script>
  </head>
  
  <body>
    This is my HTML page. <br>
    
    <table border="0">
        <tr>
          <td>Login:</td>
          <td><input type="text" name="login1" id="name"></td>
        </tr>
        <tr>
          <td>Password:</td>
          <td><input type="password" name="password2" id="pwd"></td>
        </tr> 
        <tr>
          <td colspan="2" align="center">
          
          <input type="button"  id="on" value="提交" >
        
          </td>
        </tr>
      </table>
    <ul id="ul"></ul>
    
    <script type="text/javascript">
       $("#on").click(function(){
    	   $.ajax({
    		   type:"post",//请求方式
    		  url:"/PoliceProject/servlet/TestServlet",//发送请求地址
    		   data:{//发送给数据库的数据
    			   loginName:$("#name").val(),
    		   password:$("#pwd").val()
    		   },
    		   //请求成功后的回调函数有两个参数
    		   success:function(data,textStatus){
    			   alert("data:"+data+",status"+status);
    		   }
    		    
    		   })});
       
    </script>
  </body>
</html>
